# ASP.NET Calendar Control

Web Server Controls

## Definition and Usage

The Calendar control is used to display a calendar in the browser.

This control displays a one-month calendar that allows the user to select dates and move to the next and previous months.

## Properties

Property | Description | .NET
--- | --- | ---
Caption | The caption of the calendar | 2.0
CaptionAlign | The alignment of the caption text | 2.0
CellPadding | The space, in pixels, between the cell walls and contents | 1.0
CellSpacing | The space, in pixels, between cells | 1.0
DayHeaderStyle | The style for displaying the names of the days | 1.0
DayNameFormat | The format for displaying the names of the days | 1.0
DayStyle | The style for displaying days | 1.0
FirstDayOfWeek | What should be the first day of week | 1.0
NextMonthText | The text displayed for the next month link | 1.0
NextPrevFormat | The format of the next and previous month links | 1.0
NextPrevStyle | The style for displaying next and previous month links | 1.0
OtherMonthDayStyle | The style for displaying days that are not in the current month | 1.0
PrevMonthText | The text displayed for the previous month link | 1.0
runat | Specifies that the control is a server control. Must be set to "server" | 1.0
SelectedDate | The selected date | 1.0
SelectedDates | The selected dates | 1.0
SelectedDayStyle | The style for selected days | 1.0
SelectionMode | How a user is allowed to select dates | 1.0
SelectMonthText | The text displayed for the month selection link | 1.0
SelectorStyle | The style for the month and weeks selection links | 1.0
SelectWeekText | The text displayed for the week selection link | 1.0
ShowDayHeader | A Boolean value that specifies whether the days of the week header should be shown | 1.0
ShowGridLines | A Boolean value that specifies whether the grid lines between days should be shown | 1.0
ShowNextPrevMonth | A Boolean value that specifies whether the next and previous month links should be shown | 1.0
ShowTitle | A Boolean value that specifies whether the title of the calendar should be shown | 1.0
TitleFormat | The format for the title of the calendar | 1.0
TitleStyle | The style of the title of the calendar | 1.0
TodayDayStyle | The style for today's date | 1.0
TodaysDate | Today's date | 1.0
UseAccessibleHeader | Specifying whether to use the <th> element for the day headers instead of the <td> element | 2.0
VisibleDate | The date that specifies the month that is currently visible in the calendar | 1.0
WeekendDayStyle | The style for weekends | 1.0
OnDayRender | The name of the function to be executed when when each day cell is created |
OnSelectionChanged | The name of the function to be executed when the user selects a day, week, or month |
OnVisibleMonthChanged | The name of the function to be executed when the user navigates to a different month |

## Web Control Standard Properties

AccessKey, Attributes, BackColor, BorderColor, BorderStyle, BorderWidth, CssClass, Enabled, Font, EnableTheming, ForeColor, Height, IsEnabled, SkinID, Style, TabIndex, ToolTip, Width

For a full description, go to Web Control Standard Attributes.

## Control Standard Properties

AppRelativeTemplateSourceDirectory, BindingContainer, ClientID, Controls, EnableTheming, EnableViewState, ID, NamingContainer, Page, Parent, Site, TemplateControl, TemplateSourceDirectory, UniqueID, Visible

For a full description, go to Control Standard Attributes.

## Examples

Calendar
Declare a Calendar control in its simplest use.

Calendar 2
Declare a Calendar control where the days are displayed with full names in blue, the weekends are displayed in red on a yellow background, and the current date is displayed with a green background.

Calendar 3
Declare a Calendar control where the days are displayed with full names, the user may select a day, a week, or the whole month, and the selected day/week/month is displayed with a grey background color.

Web Server Controls

### WEB HOSTING

UK Reseller Hosting

### WEB BUILDING

FREE Website BUILDER Free HTML5 Templates

### W3SCHOOLS EXAMS

HTML, CSS, JavaScript, PHP, jQuery, XML, and ASP Certifications

### SHARE THIS PAGE

### Color Picker

### HTML/CSS

HTML Tutorial HTML5 Tutorial CSS Tutorial CSS3 Tutorial Bootstrap Tutorial

### JavaScript

JavaScript Tutorial jQuery Tutorial jQuery Mobile Tutorial AngularJS Tutorial AJAX Tutorial JSON Tutorial

### Graphics

Canvas Tutorial SVG Tutorial Google Maps Tutorial

### Server Side

SQL Tutorial PHP Tutorial ASP Tutorial ASP.NET Tutorial VBScript Tutorial AppML Tutorial

### Web

Web Building Web Statistics Web Certification

### XML

XML Tutorial DTD Tutorial Schema Tutorial XML DOM Tutorial XPath Tutorial XSLT Tutorial XQuery Tutorial XSL-FO Tutorial RSS Tutorial WSDL Tutorial

### HTML/CSS

HTML Tag Reference HTML Event Reference HTML Color Reference CSS 1,2,3 Reference Bootstrap Reference

### JavaScript

JavaScript Reference HTML DOM Reference jQuery Reference jQuery Mobile Reference Google Maps Reference

### Server Side

PHP Reference SQL Reference ASP Reference VBScript Reference Razor Reference ASP.NET Reference

### XML

XML DOM Reference XSLT Reference XSL-FO Reference XPath Reference XQuery Reference Schema Reference RSS Reference SVG Reference

### HTML Charsets

HTML Character Sets HTML ASCII HTML ANSI HTML Windows-1252 HTML ISO-8859-1 HTML Symbols HTML UTF-8

### HTML/CSS

HTML Examples CSS Examples

### Browser Scripting

JavaScript Examples HTML DOM Examples jQuery Examples jQuery Mobile Examples AngularJS Examples AJAX Examples

### Server Scripting

PHP Examples ASP Examples VBScript Examples Razor Examples .NET Examples

### XML Languages

XML Examples DTD Examples XML DOM Examples XSL Examples XSLT Examples XPath Examples XQuery Examples Schema Examples RSS Examples SVG Examples